package servlet;

import bean.load;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "Cancel", value = "/Cancel")
public class Cancel extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //撤销账户，需要输入正确的账户号和密码
        String ur=request.getParameter("ur");
        String pwd=request.getParameter("pwd");
        load ld = new load();
        String SQL;
        SQL="delete from act where id='"+ur+"' and pwd='"+pwd+"'";
        ld.opert(SQL);
        response.sendRedirect("/HospitalAppointmentReg_Sys_war_exploded/jsp/login.jsp");//页面跳转
    }
}
